/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elderberryni2.data.container;

import elderberryni2.abstracts.BaseTimestampable;
import elderberryni2.interfaces.IDumpable;

/**
 *
 * @author warringer
 */
public class EnviroContainer extends BaseTimestampable<Float>
    implements Comparable<EnviroContainer>, IDumpable {
    
    private float dynP, statP, mulP, rho, temperature;

    /**
     * 
     * @param dymP
     * @param statP
     * @param mulP
     * @param rho
     * @param timestamp
     */
    public EnviroContainer(float dymP, float statP, float mulP, float rho, float temp,
            float timestamp) {
        this.dynP = dymP;
        this.statP = statP;
        this.mulP = mulP;
        this.rho = rho;
        this.temperature = temp;
        this.setTimestamp(timestamp);
    }

    /**
     * 
     * @return
     */
    public float getDynP() {
        return dynP;
    }

    /**
     * 
     * @return
     */
    public float getMulP() {
        return mulP;
    }

    /**
     * 
     * @return
     */
    public float getRho() {
        return rho;
    }

    /**
     * 
     * @return
     */
    public float getStatP() {
        return statP;
    }

    public float getTemperature() {
        return temperature;
    }

    @Override
    public Float getTimestampDifference(Float timestamp) {
        return Math.abs(this.getTimestamp() - timestamp);
    }

    /**
     * 
     * @param t
     * @return
     */
    @Override
    public int compareTo(EnviroContainer t) {
        if (this.dynP == t.getDynP() &&
                this.statP == t.getStatP() &&
                this.mulP == t.getMulP() &&
                this.rho == t.getRho() &&
                this.temperature == t.getTemperature()) {
            return 0;
        } else {
            return 1;
        }
    }

    @Override
    public String toCSV() {
        return new Float(rho).toString() 
                + ";" + new Float(dynP).toString() 
                + ";" + new Float(statP).toString() 
                + ";" + new Float(mulP).toString()
                + ";" + new Float(temperature).toString();
    }
    
    @Override
    public String getHeader() {
        return "Roh;Dynamic Pressure;Static Pressure;Pressure Multiplicator;Temperature";
    }
    
}
